From: Adel Gadllah Date: Wed, 6 Jun 2012 22:20:23 +0000 (+0200) Subject: LayoutManager: Add primary-fullscreen-changed signal X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6504 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6700f8614507a257878b3ff732b2cbbb2df63b56;p=gnome-shell.git LayoutManager: Add primary-fullscreen-changed signal Add a signal to the LayoutManager which gets emitted once the primary monitor enters or leaves the fullscreen state. https://bugzilla.gnome.org/show_bug.cgi?id=677590 --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 66bf995b9..6351ad9eb 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -53,6 +53,10 @@ const LayoutManager = new Lang.Class({ global.screen.connect('monitors-changed', Lang.bind(this, this._monitorsChanged)); this._monitorsChanged(); + + this._chrome.connect('primary-fullscreen-changed', Lang.bind(this, function(chrome, state) { + this.emit('primary-fullscreen-changed', state); + })); }, // This is called by Main after everything else is constructed; @@ -852,6 +856,8 @@ const Chrome = new Lang.Class({ for (let i = 0; i < this._monitors.length; i++) wasInFullscreen[i] = this._monitors[i].inFullscreen; + let primaryWasInFullscreen = this._primaryMonitor.inFullscreen; + this._updateFullscreen(); let changed = false; @@ -861,10 +867,15 @@ const Chrome = new Lang.Class({ break; } } + if (changed) { this._updateVisibility(); this._queueUpdateRegions(); } + + if (primaryWasInFullscreen != this._primaryMonitor.inFullscreen) { + this.emit('primary-fullscreen-changed', this._primaryMonitor.inFullscreen); + } }, updateRegions: function() { @@ -979,3 +990,5 @@ const Chrome = new Lang.Class({ return false; } }); + +Signals.addSignalMethods(Chrome.prototype);